from selenium import webdriver
from selenium.webdriver.common.by import By
import time
d = webdriver.Chrome()
d.get('https://www.qq.com')
d.maximize_window()
time.sleep(2)
# 定位搜索图标
a = d.find_element(By.CSS_SELECTOR, '[id="searchBtn"]')
res = a.is_displayed()
print(res)

# 隐藏元素：只能定位 不可以操作  click()  clear()  send_keys()
# stlye="display:none;"  type="hidden"

# 如何执行js语句  JavaScript
# window.scrollTO
js = "window.scrollTo(0,500);"
d.execute_script(js)
time.sleep(2)
d.quit()
